home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6854 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.7 KB  |  64 lines

  1. Path: sun001.spd.dsccc.com!spd!jmccarty
  2. From: jmccarty@spd.dsccc.com (Mike McCarty)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Please please help a newbie!!
  5. Date: 15 Feb 1996 19:30:04 GMT
  6. Organization: DSC Communications Corporation, Plano, Texas USA
  7. Message-ID: <4g01js$h6q@sun001.spd.dsccc.com>
  8. References: <4fth5k$43v@pacifica.access.ch>
  9. NNTP-Posting-Host: aplo139.spd.dsccc.com
  10.  
  11. In article <4fth5k$43v@pacifica.access.ch>,
  12. Thomas Beck <tombeck@usemail.com> wrote:
  13. )Hi there!
  14. )
  15. )It's quite embarrassing to ask those two questions, because they seem 
  16. )absolutely stupid (they probably are). Yesterday I started to learn C/C++. I 
  17. )bought a 700 pages book with a cd included that has two compilers on it). I 
  18. )fully understand the chapter about the types, but the things I program just 
  19. )can't be compiled. I extracted the following two problems:
  20. )
  21. )----------- example 1: -------------
  22. )int i;
  23. )int & a=i;
  24.      ^ If you are trying to declare a pointer to
  25.        an integer, and set it to point to i, then you need this line:
  26.  
  27.     int    *a = &i;
  28.  
  29.  
  30. )main() {
  31. )}
  32.  
  33. [error results cut]
  34.  
  35. )The second thing that doesn't work is this:
  36. )
  37. )----------- example 2: -------------
  38. )struct abc {
  39. )  int i;
  40. )  char a;
  41. )  void f1() {
  42.         ^ If you are trying to declare a pointer
  43.       to a function returning void, then you need
  44.         void    *f1();
  45.       no "{}" are needed.
  46. )  };
  47. )};
  48. )
  49. )main() {
  50. )}
  51.  
  52. [errors cut]
  53.  
  54. )Before you think I'm absolutely stupid... I used to be very good at Pascal 
  55.  
  56. Not stupid, just ignorance. And ignorance, like epoxy, can be cured
  57. (there is no cure for stupidity).
  58.  
  59. Mike
  60. ----
  61. char *p="char *p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
  62.  
  63. I don't speak for DSC.         <- They make me say that.
  64.